import {
  getAlbum
} from '../../utils/http'
// const audio = getApp().audio
Page({
  pageNumber: 1,
  typeListId: null, // 类别id。可不填，默认值"index"
  hotSong: [],
  async onLoad() {
    // 获取类别
    wx.showLoading({
      title: '',
      mask: true
    })
    let res = await getAlbum()
    wx.hideLoading()
    this.setData({
      album: res.album,
    })
  },
   // 加载更多
   loadMore() {
    if (this.data.hasMore) {
      this.pageNumber += 1
      this.getHotSong()
    }
  },
  toAlbumList(e) {
    let {
      id,
      title
    } = e.currentTarget.dataset
    wx.navigateTo({
      url: `/pages/albumList/index?id=${id}&navtitle=${title}`,
    })
  },
})